package com.rraj.common.enums;

public enum ResCodeEnums {

	SUCCESS("返回成功",10000),
	ERROR("操作异常，请稍后再试", -10000),
	SYSTEM_ERROR("系统异常，请稍候再试", -1),
	REQUEST_ERROR("啊呀，您的请求有些问题，请确认后再试", -2),
	APP_UPDATE("版本升级", 9999),
	//登录相关
	NO_LOGIN_ERROR("请先登录", 20000),
	VALID_CODE_ERROR("验证码错误", 20001),
	SIGN_ERROR("签名异常，请检查请求参数", 20002),

	//发送验证码
	MOBILE_ERROR("请输入正确的手机号码", 22001),
	MOBILECODE_ERROR("获取验证码失败，请联系客服处理", 22002),
	LIMIT_EVERY_MINUTE_MOBILECODE("一分钟只允许获取一次短信，请勿频繁获取", 22003),
	USER_REGISTERED("亲~此号码已注册了", 22004),
	USER_NOT_LOGIN("请登录", 22005),
	MOBILE_NOT_REGISTER("该手机号尚未注册", 22006),
	MOBILE_CODE_USELESS("验证码失效，请重新获取验证码", -22007),
	MOBILE_CODE_WANG("验证码错误", -22008),
	MOBILE_USER_MOBILE_WANG("输入手机号与用户手机号不一致", -22009),

	//手机的验证码登录
	LOGIN_LIMIT_DEVICE("您本台设备的注册量已达到上限，如有疑问，请拨打客服热线400-667-0571咨询。", -21009),
	LOGIN_USER_PROHIBIT("抱歉，用户暂时被禁止登录。如有疑问请与客服联系，400-667-0571。", -21010),
	CKECK_TOKEN("登录信息已失效,请重新登录", -21011),

	//登录授权
	CKECK_ACCREDIT("未授权或授权已过期，请重新授权", -23012),
	FIRST_ACCREDIT("首次授权，需手机验证码验证授权", -23013),
	ACCREDIT_FAIL("授权失败，请联系管理员", -23014),
	CKECK_ACCREDIT_FIRST("校验授权失败，请联系管理员", -23012),

	//注册用户
	REGISTER_USER_NO_MEMBER("暂不支持非人人爱家金融用户登录", -24001),
	REGISTER_USER_IDCARD("身份证问题，请联系客服", -24002),

	//爱家接口相关
	AJB_API_FAIL("爱家接口调用失败",-25001),

	//参数有误
	ARGS_ERROR("参数有误，请检查参数", -30000),


	//活动相关
	LUCK_DRAW("没有抽奖资格",40004),
	ACTIVITY_START("活动未开始",40001),
	ACTIVITY_END("活动已结束",40002),


	//红包相关
	COUPON_NOT_EXIT("优惠券不存在", -50001),
	COUPON_STATUS_ERROR("优惠券状态不对", -50002),
	COUPON_BEFORE_USE_TIME("优惠券暂时不可使用", -50003),
	COUPON_OVER_DUE("优惠券已经过期，不可以使用", -50004),
	COUPON_INVESTMONEY_OR_INTEREST_LESS("优惠券不够使用标准", -50005),
	COUPON_NOT_USE("优惠券不支持该项目使用", -50006),

	//消息相关
	MESSAGE_READED("消息已读", -60001),
	MESSAGE_READ_FAILURE("消息读取失败", -60002),
	MESSAGE_NO_UNREAD_MESSAGE("没有未读消息", -60003),
	MESSAGE_READ_ALL_MESSAGE_FAILURE("读全部消息失败", -60004),
	MESSAGE_SEND_FAILURE("发送消息失败", -60005),
	MESSAGE_DEL_FAILURE("删除消息失败", -60006),

	//额度相关
	ALREADY_SYNC_QUOTA_SUCCESS("用户已经同步过今天的额度，无需再次同步", 70000),

	NO_USER_LOAN_AMOUNT("没有找到用户额度", -70000),
	NO_DEDUCTION_LOAN_AMOUNT("没有找到可以扣减的用户额度", -70001),
	DEDUCTION_LOAN_AMOUNT_FAIL("扣减用户额度失败", -70002),
	INSERT_USER_LOAN_AMOUNT_DETAIL_FAIL("新增用户额度详情信息失败", -70003),
	OUT_USER_MAX_LOAN_AMOUNT("超出用户总计最大借款额度", -70004),
	UPDATE_USER_LOAN_AMOUNT_FAIL("更新用户额度信息失败", -70005),
	NO_USER_LOAN_AMOUNT_DETAIL_ROLLBACK("没有可以回滚的额度明细", -70006),
	ROLLBACK_USER_LOAN_AMOUNT_FAIL("回滚用户额度失败", -70007),
	NO_TOTAL_AMOUNT_RESIDUAL_FOUND("获取总放款额度剩余失败", -70008),
	NO_LIMIT_DAY_AMOUNT_FOUND("获取总每日放款限额失败", -70009),
	NO_TODAY_DAY_AMOUNT_FOUND("获取总今日已放款金额失败", -70010),
	UPDATE_LOAN_AMOUNT_AFTER_ORDER_SUSSESS_FAIL("超出系统总借款额度最大限制", -70011),
	INSERT_LOAN_AMOUNT_DETAIL_AFTER_ORDER_SUSSESS_FAIL("订单审核通过后插入总借款明细失败", -70012),
	GET_USER_LOAN_AMOUNT_DETAIL_LIST_FAIL("获取用户创建订单扣减额度详情列表失败", -70013),
	LOANAMOUNT_USERID_IS_NULL("用户ID不能为空", -70014),
	LOANAMOUNT_QUERY_DATE_IS_NULL("查询日期不能为空", -70015),
	CHECKDEDUCTIONUSERLOANAMOUNT_USERID_NULL("扣减额度的入参【用户ID】为NULL", -70016),
	CHECKDEDUCTIONUSERLOANAMOUNT_DATE_NULL("扣减额度的入参【借款日期】为NULL", -70017),
	CHECKDEDUCTIONUSERLOANAMOUNT_ORDERID_NULL("扣减额度的入参【订单ID】为NULL", -70018),
	CHECKDEDUCTIONUSERLOANAMOUNT_LOANDAYS_NULL("扣减额度的入参【借款天数】为NULL", -70019),
	CHECKDEDUCTIONUSERLOANAMOUNT_LOANAMOUNT_NULL("扣减额度的入参【借款金额】为NULL", -70020),
	LOANDAYS_SMALL_THAN_MIN("借款天数小于用户的最小借款天数", -70021),
	LOANDAYS_BIG_THAN_MAX("借款天数大于用户的最大借款天数", -70022),
	LOANAMOUNT_SMALL_THAN_MIN("借款金额小于用户的最小借款金额", -70023),
	LOANAMOUNT_BIG_THAN_MAX("借款金额大于用户的最大借款金额", -70024),
	ROLLBACK_USER_LOAN_AMOUNT_USERID_NULL("回滚额度的入参【用户ID】为NULL", -70025),
	ROLLBACK_USER_LOAN_AMOUNT_ORDERID_NULL("回滚额度的入参【订单ID】为NULL", -70026),
	UPDATE_LOAN_AMOUNT_AFTER_REPAYMENT_USERID_NULL("还款更新额度的入参【用户ID】为NULL", -70027),
	UPDATE_LOAN_AMOUNT_AFTER_REPAYMENT_ORDERID_NULL("还款更新额度的入参【订单ID】为NULL", -70028),
	UPDATE_LOAN_AMOUNT_AFTER_REPAYMENT_REPAYMENTAMOUNT_NULL("还款更新额度的入参【还款金额】为NULL", -70029),
	UPDATE_LOAN_AMOUNT_AFTER_REPAYMENT_REPAYMENTAMOUNT_SMALL_ZERO("还款更新额度的入参【还款金额】小于或等于0", -70030),
	NO_REPAYMENT_LOAN_AMOUNT_FOUND("没有找到可以还款的用户额度", -70031),
	UPDATE_USER_USED_LOAN_AMOUNT_FORREPAYMENT_FAIL("还款时扣减用户的已使用金额失败", -70032),
	INSERT_USER_LOAN_AMOUNT_DETAIL_FORREPAYMENT_FAIL("还款时插入额度还款明细信息失败", -70033),
	UPDATE_TOTAL_USED_AMOUNT_FORREPAYMENT_FAIL("还款时更新总的已使用额度失败", -70034),
	INSERT_LOAN_AMOUNT_DETAIL_FAIL("插入总额度改变明细表失败", -70035),
	NO_REAL_NAME_USER_FOUND("请先完成实名认证", -70036),
	GET_PROJECT_BY_MOBILE_FROM_AIJIABAO_FAIL("从爱家宝获取项目信息失败", -70037),
	INSERT_USER_LOAN_AMOUNT_FOR_SYNC_FAIL("同步额度时插入额度信息失败", -70038),
	CHECK_GET_USER_LOAN_AMOUNT_NO_LOGIN("获取用户额度失败：用户未登录", -70039),
	CHECK_GET_USER_LOAN_AMOUNT_OVERDUE("获取用户额度失败：用户存在逾期借款", -70040),
	CHECK_GET_USER_LOAN_AMOUNT_AMOUNT_OVER("获取用户额度失败：用户额度已经用完", -70041),
	CHECK_GET_USER_LOAN_AMOUNT_NO_AMOUNT("获取用户额度失败：用户没有可用额度", -70042),
	CHECK_GET_USER_LOAN_AMOUNT_CHECKUSERAGE_ERROR("获取用户额度失败：年龄校验失败", -70043),
	UPDATE_USER_LOAN_AMOUNT_DETAIL_FAIL("更新用户额度详情信息失败", -70044),
	OVERSTEP_TOTAL_AMOUNT_LIMIT("超出总借款额度限制", -70045),
	OVERSTEP_TODAY_AMOUNT_LIMIT("超出每天总借款额度限制", -70046),
	LOANAMOUNT_LOAN_DATE_IS_NULL("借款日期不能为空", -70047),
	INSERT_USER_CURRENT_DAY_LOAN_AMOUNT_FOR_REPAYMENT_FAIL("还款后更新用户今日额度详情失败", -70048),

	//银行卡相关
	NO_USER_BANK_CARD_LIST_FOUND("获取用户银行卡列表失败", -80000),
	GET_USER_DEFAULT_BANK_CARD_BYUSER_FAIL("获取用户的默认银行卡失败", -80001),
	GET_USER_BANK_CARD_BY_ID_FAIL("根据ID获取用户银行卡失败", -80002),
	GET_USER_BANK_CARD_BYCARDNO_FAIL("根据银行卡号获取用户银行卡失败", -80003),
	INSERT_USER_BANK_CARD_FAIL("绑定用户银行卡失败", -80004),
	CHECK_BIND_USER_BANK_CARD_FAIL_BANK_EXIST("绑定用户银行卡失败：银行卡已经存在", -80005),
	UPDATE_USER_BANK_CARD_FAIL("更新用户银行卡失败", -80006),
	CHECK_BIND_USER_BANK_CARD_FAIL_NO_REALNAME("更新用户银行卡失败", -80007),
	INSERT_USER_BANK_CARD_FAIL_NO_BANK_INFO("绑定用户银行卡失败：获取银行信息失败", -80008),
	USER_BANK_CARD_CARDID_IS_NULL("银行卡不能为空", -80009),
	USER_IDENTITY_CARD_IS_NULL("获取用户身份信息失败", -80010),

	//合同相关
	IDENTITY_CARD_NOT_EXIT("身份证不存在", -90001),
	FDD_CUSTOMER_NOT_EXIT("法大大用户不存在", -90002),
	UPDATE_FDD_INFO_FAILURE("更新法大大账户信息失败", -90003),
	UPLOAD_TEMPLATE_FAILURE("模板上传失败", -90004),
	CONTRACT_TYPE_NOT_EXIT("合同类型不存在", -90005),
	CONTRACT_TEMPLATE_NOT_EXIT("本地合同模板不存在", -90006),
	BORROWER_CONTRACT_CREATE_FAILURE("借款合同创建失败", -90007),
	TRANSFER_CONTRACT_CREATE_FAILURE("债权转让合同创建失败", -90008),
	CONTRACT_NOT_EXIT("合同不存在", -90009),
	SIGN_CONTRACT_FAILURE("签署合同失败", -90010),
	REGIST_FDD_CUSTOMER_FAILURE("注册法大大用户失败", -90011),


	ORDER_DONE("该订单已经被处理，请刷新",100001),
	ORDER_REFRESH("请刷新后，再试",100002),
	ORDER_AMOUNT("金额不合法",100003),
	ORDER_DAY("天数不合法",100004),
	ORDER_NOT_EXISTS("订单不存在",100005),
	ORDER_AUDIT_PARAM("审批参数不合法",100006);

	private String resMsg;
	private int resCode;

	ResCodeEnums(String resMsg, int resCode) {
		this.resMsg = resMsg;
		this.resCode = resCode;
	}
	@Override
	public String toString(){
		return "code:" + this.getResCode() + ",msg:" + this.getResMsg();
	}

	public String getResMsg() {
		return resMsg;
	}

	public int getResCode() {
		return resCode;
	}

	public boolean isSuccess(){
		return this.getResCode() == ResCodeEnums.SUCCESS.getResCode();
	}

}
